#ifndef __FRAME_WORK__
#define __FRAME_WORK__

#pragma once
#if defined(_WIN32)
#include <Windows.h>
#else
typedef unsigned int  uint32_t;
typedef uint32_t UINT;
typedef void VOID;
typedef double DOUBLE;
#endif
#include <math.h>
#include <iostream>
#include <assert.h>
#include <iomanip>

// 矩阵旋转类型,包含x轴,y轴,z轴
enum class ROTATE_TYPE :UINT {
    ROTATE_X = 000,
    ROTATE_Y = 001,
    ROTATE_Z = 002
};

using namespace std;


#define PI 3.141592653
#define DOUBLE_PI    PI*2
#define HALF_PI        PI/2
#define HALF_VALUE(value)        value*0.5f
                        


// 定义欧拉角变量
#define DECLARE_EULER_ANGLE_VAR                    \
        double cosBank        = 0.0f;                \
        double sinBank        = 0.0f;                \
        double cosPitch        = 0.0f;                \
        double sinPitch        = 0.0f;                \
        double cosHeading    = 0.0f;                \
        double sinHeading    = 0.0f;
                        
#define DEFINE_EULER_ANGLE_VAR(angle)                            \
        double cosBank        = cos(angle.GetBank());                \
        double sinBank        = sin(angle.GetBank());                \
        double cosPitch        = cos(angle.GetPitch());            \
        double sinPitch        = sin(angle.GetPitch());            \
        double cosHeading    = cos(angle.GetHeading());            \
        double sinHeading    = sin(angle.GetHeading());

// 声明矩阵中所有数据变量
#define DECLARE_MATRIX_DATA_VAR                                    \
        double m11= 0.0f;                                        \
        double m12= 0.0f;                                        \
        double m13= 0.0f;                                        \
        double m21= 0.0f;                                        \
        double m22= 0.0f;                                        \
        double m23= 0.0f;                                        \
        double m31= 0.0f;                                        \
        double m32= 0.0f;                                        \
        double m33= 0.0f;                    

// 定义矩阵中所有数据变量并附初值
#define DEFINE_MATRIX_DATA_VAR(pNormalMatrixData)        \
        double m11=pNormalMatrixData[0][0];                \
        double m12=pNormalMatrixData[0][1];                \
        double m13=pNormalMatrixData[0][2];                \
        double m21=pNormalMatrixData[1][0];                \
        double m22=pNormalMatrixData[1][1];                \
        double m23=pNormalMatrixData[1][2];                \
        double m31=pNormalMatrixData[2][0];                \
        double m32=pNormalMatrixData[2][1];                \
        double m33=pNormalMatrixData[2][2];                


// 声明代数余子矩阵所有变量
#define DECLARE_ALGEBRAIC_COSUBMATRIX_VAR            \
        double c11=0.0f;                            \
        double c12=0.0f;                            \
        double c13=0.0f;                            \
        double c21=0.0f;                            \
        double c22=0.0f;                            \
        double c23=0.0f;                            \
        double c31=0.0f;                            \
        double c32=0.0f;                            \
        double c33=0.0f;                            


template<class T>
VOID SafeDeletePoint(T& t) {
    if (t != NULL)
    {
        delete[] t;
        t = NULL;
    }
}

#endif // !__FRAME_WORK__
